﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using Microsoft.Xna.Framework;

namespace XnaGameStudio1
{
    //-----------------------------------------------------------------------------------------------
    public partial class GameWindow : Form
    {
        Timer updateTimer;
        Timer drawTimer;
		long tickTime;
        Engine.Mesh waterMesh;

        public GameWindow()
        {
            InitializeComponent();

            LoadTestMesh();

			tickTime = 0;

            drawTimer = new Timer();
            drawTimer.Interval = 50;
            drawTimer.Tick += new EventHandler(DrawHandler);
            drawTimer.Start();
        }

        private void LoadTestMesh()
        {
            waterMesh = new Engine.Mesh(viewPanel.GraphicsDevice);
          
        }

        private void DrawHandler( object sender, EventArgs e)
        {
			if (DateTime.Now.Ticks - tickTime < 3333333 )
				return;
			tickTime = DateTime.Now.Ticks;

            viewPanel.BeginDraw();

            viewPanel.EndDraw();

        }
    }
}
